<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <!-- import CSS -->
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
    <script src="./../../js/jquery.mini.js"></script>
</head>
<body>
<div id="app">
    <el-button @click="visible = true">Button</el-button>
    <el-dialog :visible.sync="visible" title="Hello world">
        <p>Try Element</p>
    </el-dialog>

    <el-button @click="requestUpDown">requestUpDown</el-button>

    <el-button @click="requestUpDown1">点击啊</el-button>

    <span> {{number}}</span>


    <el-input v-model="inputNumber" placeholder="请输入内容"></el-input>
    <div> {{cNumber}}</div>
    <!--<div @click="requestUpDown1">-->
         <!--点击啊-->
    <!--</div>-->
</div>
</body>
<!-- import Vue before Element -->
<script src="https://unpkg.com/vue/dist/vue.js"></script>
<!-- import JavaScript -->
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
<script>
    new Vue({
        el: '#app',
        data: function () {
            return {
                visible: false,
                number:0,
                inputNumber:''
            }
        },
        components: {},
        created() {
            this.requestUpDown()
        },
        updated() {
        },
        mounted() {
        },
        computed: {
            cNumber(){
                return this.inputNumber
            }
            // imageList() {
            //   console.log(this.dialogDataForm.imageList);
            //   return this.dialogDataForm.imageList.map(value => value.image)
            // }
        },
        methods: {
            requestUpDown() {
                console.log('啊哈哈')
                $.ajax({
                    type: 'get',
                    url: 'http://192.168.0.103:8005/test/data',
                    processData: false,
                    // data: formData,
                    contentType: false,
                    async:true,
                    dataType:'json',
                    success: function(res){
                        var data = res.data
                       window.alert('==' + JSON.stringify(res))
                    },
                    error:function(e){
                        console.log(e);
                        $("#addModalUpload").modal("hide");
                        alert("请求失败");
                        file = $('#file').val("");
                    }
                });
            },
            requestUpDown1(){
                this.number++
                console.log('啊哈哈1111')
            }
        }
    })
</script>
</html>
